/**
 * Application Application.java
 */

package CCT220_Aula19_Exercicio01_13106;


import java.awt.BorderLayout;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;

import javax.swing.JComboBox;
import javax.swing.JFrame;
import javax.swing.JTextField;


/**
 * </br>******************************
 * </br>Project: CCT220
 * </br>Package: CCT220_Aula19_Exercicio01_13106
 * </br>Class: Application
 * </br>Last Change: 28/10/2011 19:06:45 by marcel
 * </br>Description:
 * </br>******************************</br>
 * 
 * @author marcel
 * @author 13106
 * 
 */
public class Application {

	private JComboBox  jcb;
	private JTextField jtf;


	public Application() {

		this.startComponents();
		JFrame jf = new JFrame("Marcel M. Grilo - 13106");
		jf.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
		jf.setSize(200, 100);
		jf.setLayout(new BorderLayout());
		jf.add(jcb, BorderLayout.NORTH);
		jf.add(jtf, BorderLayout.SOUTH);
		jf.setVisible(true);

	}


	public void startComponents() {

		jcb = new JComboBox();
		jtf = new JTextField();
		jtf.addActionListener(new ActionListener() {
			@Override
			public void actionPerformed(ActionEvent e) {

				jcb.addItem(jtf.getText());
			}
		});
	}


	public static void main(String[] args) {

		new Application();
	}
}
